// import React, { useEffect, useRef, useState } from "react";

// function Ccc() {
//     // const [num, setNum] = useState(1);
//     const [num, setNum] = useState<number>();

//     const ref = useRef<HTMLDivElement>(null);
//     // const ref = useRef<HTMLDivElement>();
//     return <div ref={ref}>ccc</div>
// }

// function App() {
//   return <div>
//     <Ccc></Ccc>
//   </div>
// }

// export default App;

import React, { useEffect, useRef, useState } from "react";

function Ccc() {
  const [num, setNum] = useState<number>();
//   const ref = useRef<{ num: number }>(null);
  const ref = useRef<{ num: number }>();
  ref.current = { num: 2 };
  return <div>ccc</div>;
}

function App() {
  return (
    <div>
      <Ccc></Ccc>
    </div>
  );
}

export default App;
